package com.molichuxing.services.infrastructure.service;

import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.infrastructure.dto.request.create.WechatpayCreateDto;
import com.molichuxing.services.infrastructure.dto.response.PrepaymentDto;
import com.molichuxing.services.infrastructure.dto.response.WechatpayResultDto;
import com.molichuxing.services.property.sdk.WechatpayTradeTypeEnum;

public interface WechatpayService extends RootService {

	/**
	 * 统一下单(预支付单)
	 * 
	 * @param createDto
	 * @return
	 * @throws Exception
	 */
	public PrepaymentDto orderPay(WechatpayCreateDto createDto) throws Exception;

	/**
	 * 查询订单
	 * 
	 * @param outTradeNo
	 *            商户订单号
	 * @param tradeType
	 *            交易类型
	 * @return
	 * @throws Exception
	 */
	public WechatpayResultDto orderQuery(String outTradeNo, WechatpayTradeTypeEnum tradeType) throws Exception;

	/**
	 * 关闭订单
	 * 
	 * @param outTradeNo
	 *            商户订单号
	 * @param tradeType
	 *            交易类型
	 * @return
	 * @throws Exception
	 */
	public Boolean orderClose(String outTradeNo, WechatpayTradeTypeEnum tradeType) throws Exception;

	/**
	 * 微信支付结果异步通知解析
	 * 
	 * @param notifyStr
	 *            通知信息
	 * @param tradeType
	 *            交易类型
	 * @return
	 * @throws Exception
	 */
	public WechatpayResultDto notifyPay(String notifyStr, WechatpayTradeTypeEnum tradeType) throws Exception;
}
